<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5 Transitional//EN">
<%@ page pageEncoding="UTF-8" %>
<%@ page import="jp.co.technotree.apl.api.common.Message,jp.co.technotree.common.ApplicationManager" %>
<%@ page import="jp.co.technotree.apl.cmd.spare.Spa2000Bean,jp.co.technotree.apl.api.common.GlobalConst;" %>
<jsp:useBean id="formBean" class="jp.co.technotree.apl.cmd.spare.Spa2000Bean" scope="request" />
<%
	ApplicationManager appMng = ApplicationManager.getInstance();	//アプリケーションマネージャの取得（パス等）
	String strDisplayCate = formBean.getDisplayCate();	// inv3100=直結看板仮品番モード
	String strOutputCate = formBean.getOutputCate();	//1=新規モード 2=直結看板変更モード
%>
<html>
<head>


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes"/>
<!-- 数字を電話番号にさせない -->
<meta name="format-detection" content="telephone=no"/>
<link rel='stylesheet' type='text/css' href='../../common/css/spare/spa2100.css' >
<script type='text/javascript' src='../../common/js/NumKeyBoard.js'></script>

<!--ポップアップ用-->
<link rel='stylesheet' type='text/css' href='../../common/css/popUp.css' >
<script type='text/javascript' src='../../common/js/popUp.js'></script>

<!-- ITEM-DROPDOWN START -->
<link rel="stylesheet" href="../../common/js/dropdown/dropdown.css" type="text/css">
<script src="../../common/js/dropdown/dropdown.js" type="text/javascript"></script>
<!-- ITEM-DROPDOWN END -->

<style type="text/css">

	.mainTbl_Left{
		 border: 0px solid #CCCCFF;
		 height:150px;
		 width: 210px;
		 margin-top:-250px;
		 align:center;
	}

	.mainTbl_Right{
		 border: 0px solid #CCCCFF;
		 height:550px;
	}


	.confirmBtn {
		width: 80px;
		height:50px;
		font-size:18px;
	}

	.orderCompletionBtn {
		width: 140px;
		height:30px;
		font-size:14px;
	}

	.confirmBtn2 {
		width: 120px;
		height:50px;
		font-size:18px;
	}


	.confirmBtn3 {
		width: 170px;
		height:50px;
		font-size:18px;
	}

	.selTitle{
	 font-size:16px;
	 valign:middle;

	}

	.ImageZone{
	 position:absolute;
	 top :90px;
	 right:160px;
	 visibility: visible;

	 width: 200px;
	 height:200px;
	}



	.OrderReason{
	 position:absolute;
	 top :100px;
	 left:660px;
	 visibility: visible;

	 width: 300px;
	 height:200px;
	}


	.fileBtn{
		width: 320px;
		height: 80px;
		margin-top:1px;
		background-image: -webkit-gradient(linear, left top, left bottom, from(#6699CC), to(#6699CC),color-stop(0.7,#6688CC));
		color: #fff;
		font-weight:bold;
		text-shadow: -1px 2px rgba(0,0,0,0.2);
		font-size:30px;
		-webkit-border-radius:10px;

		position:relative; z-index:1;
	}

	.ReadStyle{
		 background-color:#CCC;
	}
</style>



<script language='javascript'>

//画面固定
//document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);

function onInit(){
	//処理完了後、メッセーを出してメイン画面に遷移
	var stateFlg = "<%=formBean.getStateFlg()%>";
	
	var afterFunc="nextPageJump('spa1000');";
	if(stateFlg == "1"){
		//登録処理を正常に完了しました
		alert_Info2("<%=Message.getMessage("INF00030").replace("$1", "直結看板以外予備品情報")%>",afterFunc);
	}
	
	if(stateFlg == "2"){
		//変更処理を正常に完了しました
		alert_Info2("<%=Message.getMessage("INF00040").replace("$1", "直結看板以外予備品情報")%>",afterFunc);
	}
	//削除にチェックが入ってる時の処理
	delDivChange();
	
	//-------------------------------------------------------------------------
	//<!-- NumKeyBoard START -->
	ProcStart	= new Date();

	clsNKB.init("NumKeyBoardID");
//	clsNKB.parentElement	= document.getElementById("BodyBlock");

	clsNKB.textFontSize		= 20;
	clsNKB.buttonFontSize	= 30;
	clsNKB.boxX				= -70;
	clsNKB.boxY				= 0;
	clsNKB.boxBalloonOffset	= 210;
	//<!-- NumKeyBoard END -->
	//-------------------------------------------------------------------------
	
	//-------------------------------------------------------------------------
	//<!-- RACKNO-DROPDOWN START -->
	var panel2 = document.getElementById("dropdown-panel2");
	var input2 = document.getElementById("addTable");
	var targetList2 = getElementsByClassName2(input2,"input","rackNo",true);
	dropdown2 = new CItemDropDownList(targetList2,panel2,"drop-contents2");
	dropdown2.setKeyUpEvent(text_onKeyUp2);
	dropdown2.setSelectEvent(list_onSelect2);
	dropdown2.serverURL="../rac1099/rac1099";
	
	//
	dropdown2.createTable=function(object,sender,json) {
		var itemList = this.itemList;
		var tableText = "<table cellspacing='0' cellpadding='0' border='0' id='"+this.tableName+"'>";
		if (itemList!=null && itemList.length!=0) {
			for ( var i=0; itemList && i<itemList.length; i++ ){
				var item = itemList[i];
				
				tableText+= "<tr>";
				tableText+= "<td>"+item.value1+"</td>";
				tableText+= "</tr>";
			}
		} else {
			tableText+= "<tr>";
			tableText+= "<td>該当なし</td>";
			tableText+= "</tr>";
			tableText+= "</table>";
		}
		tableText+= "</table>";
		
		var canvas = document.getElementById(this.canvasName);
		canvas.innerHTML=tableText;
	}
	//<!-- RACKNO-DROPDOWN END -->
	//-------------------------------------------------------------------------
	
	//-------------------------------------------------------------------------
	//<!-- 設備機番 START --> 
	var panel3 = document.getElementById("dropdown-panel3");
	
	var input3 = document.getElementById("addTable");
	var targetList3 = getElementsByClassName3(input3,"input","machineNo",true);
	dropdown3 = new CItemDropDownList(targetList3,panel3,"drop-contents3");
	dropdown3.setKeyUpEvent(text_onKeyUp3);
	dropdown3.setSelectEvent(list_onSelect3);
	dropdown3.serverURL="../sys1099/sys1099";
	
	dropdown3.createTable=function(object,sender,json) {
		var itemList = this.itemList;
		var tableText = "<table cellspacing='0' cellpadding='0' border='0' id='"+this.tableName+"'>";
		if (itemList!=null && itemList.length!=0) {
			for ( var i=0; itemList && i<itemList.length; i++ ){
				var item = itemList[i];
				
				tableText+= "<tr>";
				tableText+= "<td>"+item.value1+"</td>";
				tableText+= "</tr>";
			}
		} else {
			tableText+= "<tr>";
			tableText+= "<td>該当なし</td>";
			tableText+= "</tr>";
			tableText+= "</table>";
		}
		tableText+= "</table>";
		
		var canvas = document.getElementById(this.canvasName);
		canvas.innerHTML=tableText;
	}
	//-------------------------------------------------------------------------
}


function nextPageJump(nextPage){
	mainForm = document.getElementById("F1");
	document.getElementById("nextPage").value = nextPage;
	mainForm.submit();
}

//Y品番ハイフンを付ける
function itemNoKeyUp(obj){
	var value = obj.value;
	//-----------------------------------------------
	//品番自動ハイフン「-」を付ける
	var chkLen=5;
	if(event.keyCode != 0008){
		//指定の桁以上ならスタート
		if(value.length>=chkLen){
			var hikaku = value.substring(chkLen, chkLen+1);
			if(hikaku != "-"){
				var frontValue = value.substring(0, chkLen);
				var backValue  = value.substring(chkLen, value.length);
				obj.value=frontValue+"-"+backValue;
			}
		}
	}
	
	//小文字を大文字へ
	obj.value = obj.value.toUpperCase();
	value = obj.value;
	//-----------------------------------------------
}

//戻るボタン押下
function backBtn(nextPage){
	var changeFlg = changeCheck()
	if(changeFlg=="1"){
		//発注処理を中止します。よろしいですか？
		var afterFunc="nextPageJump('"+nextPage+"');";
		if (!confirm_Custom3("<%=Message.getMessage("INF01040").replace("$1", "直結看板以外予備品メンテナンス処理")%>",afterFunc)){
			return ;
		}
	}else{
		nextPageJump(nextPage);
	}
}

//編集を行ったかチェック
//return:0=変更なし 1=変更あり
function changeCheck() {
	var frm=document.main;
	var changeFlg = "0";
	
	//変更以外
	<%if(!"2".equals(strOutputCate)){ %>
		obj=frm["itemNo"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	<%} %>

	obj=frm["itemNm"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	obj=frm["model"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	obj=frm["unitPrice"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	obj=frm["leadTm"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	obj=frm["basicStock"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	obj=frm["odrLot"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	obj=frm["odrPoint"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	obj=frm["newStock"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	obj=frm["usedStock"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	obj=frm["upReason"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	obj=frm["rackNo"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	obj=frm["machineNo"]; if (obj.defaultValue != obj.value) {changeFlg="1";}
	//セレクトボックスのチェック
	//obj=frm["rackNo"]; if (obj.options[obj.selectedIndex].defaultSelected == false) {changeFlg="1";}
	obj=frm["cntDiv"]; if (obj.options[obj.selectedIndex].defaultSelected == false) {changeFlg="1";}
	//obj=frm["machineNo"]; if (obj.options[obj.selectedIndex].defaultSelected == false) {changeFlg="1";}
	obj=frm["supplier"]; if (obj.options[obj.selectedIndex].defaultSelected == false) {changeFlg="1";}
	obj=frm["partsMaker"]; if (obj.options[obj.selectedIndex].defaultSelected == false) {changeFlg="1";}
	return changeFlg;
}

//-------------------------------------------------------------------------
//<!-- ポップアップ START -->

//パップアップ解除
function back(){
	document.getElementById("opAlertBtn").style.display = "none";
	document.getElementById("opAlert").style.display = "none";
	document.getElementById("opAlertButton").style.display = "none";
	document.getElementById("opAlertTop").style.display = "none";
	document.getElementById("allbackgr").style.display = "none";
}

//<!-- ポップアップ END -->
//-------------------------------------------------------------------------

//-------------------------------------------------------------------------
//<!-- RACKNO-DROPDOWN START -->
var dropdown2 = null;

var inputDateTime2 = null;
var timerId2 = null;
var eventSrc2={};
function text_onKeyUp2(object,sender,evt){
	
	document.getElementById("rackNo").value = "";   //キーを削除
	
	var value = sender.value;
	eventSrc2.object = object;
	eventSrc2.sender = sender;
	eventSrc2.evt = evt;
	inputDateTime2 = new Date();
	//-----------------------------------------------
	//品番自動ハイフン「-」を付ける
	var chkLen=2;
	if(event.keyCode != 0008){
		//指定の桁以上ならスタート
		if(value.length>=chkLen){
			var hikaku = value.substring(chkLen, chkLen+1);
			if(hikaku != "-"){
				var frontValue = value.substring(0, chkLen);
				var backValue  = value.substring(chkLen, value.length);
				sender.value=frontValue+"-"+backValue;
			}
		}
	}
	//品番自動ハイフン「-」を付ける
	var chkLen=5;
	if(event.keyCode != 0008){
		//指定の桁以上ならスタート
		if(value.length>=chkLen){
			var hikaku = value.substring(chkLen, chkLen+1);
			if(hikaku != "-"){
				var frontValue = value.substring(0, chkLen);
				var backValue  = value.substring(chkLen, value.length);
				sender.value=frontValue+"-"+backValue;
			}
		}
	}
	//小文字を大文字へ
	sender.value = sender.value.toUpperCase();
	value = sender.value;
	//-----------------------------------------------
	if ( value.length >= <%=formBean.getTanaKensu() %> ){
		if ( evt.keyCode == 37 || evt.keyCode == 39 ){
			
		}else{
			if ( timerId2 == null ){
				// 連続送信防止
				timerId2 = window.setTimeout(function(){text_onTimeOut2(object,sender,evt);},500);
			}
		}
	}
}

/**
* 一定時間入力が止まった場合に動作
*/
function text_onTimeOut2(object,sender,evt){
	var nowDateTime = new Date();
	var lngTime = (nowDateTime.getTime()-inputDateTime2.getTime());
	if ( lngTime >= 1000 ){
		timerId2 = null;
		xmlRequest2(object,sender,evt);
	}else{
		timerId2 = window.setTimeout(function(){text_onTimeOut2(eventSrc2.object,eventSrc2.sender,eventSrc2.evt);},500);
	}
}

/**
* XML要求処理
*/
function xmlRequest2(object,sender,evt){
	//alert_Custom(evt.keyCode);
	var table = document.getElementById("drop-contents2");
	table.innerHTML="";
	
	var top = calculateOffsetTop(sender);
	var left = calculateOffsetLeft(sender);
	var height = sender.offsetHeight;
	var panel = document.getElementById("dropdown-panel2");
	panel.style.top=top+height+"px";
	panel.style.left=left+"px";
	panel.style.display="block";
	
	var param="sysId=<%=GlobalConst.TANA%>&"+"value1="+sender.value+"";
	
	try {
		var frm = document.main;
		var objs = frm["invCate"];
		if (objs[1].checked == true){
			//仮入出庫
			param += "&afterProc=1";
		}
	} catch (e) {
		
	}

	object.doXmlRequest(object,sender,param);
}


/**
* リスト選択時コールバック処理
*/
function list_onSelect2(object,sender,json){
	var panel = document.getElementById("dropdown-panel2");
	panel.style.display="none";
	sender.focus();
	
	//----------
	var name=sender.name;
	var idx=name.substring(name.indexOf("[")+1,name.length-1);
	
	document.getElementById("rackNo").value=json.valuecd;
	document.getElementById("rackNoTxt").value=json.value1;
}


function getElementsByClassName2(parent,tagName,className,fullMatch){
	var i=0,j=0;
	var result = [], cnt = 0;
	var list = parent.getElementsByTagName(tagName);
	for ( i=0; i<list.length; i++ ){
		var name = list[i].className;
		if ( name ){
			var nameList = name.split(' ');
			for ( j=0; j<nameList.length; j++ ){
				if ( fullMatch ){
					if ( nameList[j] == className ){
						result[cnt++] = list[i];
					}
				}else{
					if ( nameList[j].indexOf(className) != -1 ){
						result[cnt++] = list[i];
					}
				}
			}
		}
	}
	return result;
}
function closeBtn2(){
	var panel = document.getElementById("dropdown-panel2");
	panel.style.display="none";
} 
//----------------------------------------------------------------------

//-------------------------------------------------------------------------
//<!-- 設備機番-DROPDOWN START -->
var dropdown3 = null;

var inputDateTime3 = null;
var timerId3 = null;
var eventSrc3={};
function text_onKeyUp3(object,sender,evt){
	
	
	document.getElementById("machineNo").value = "";   //設備機番キーを削除
	
	var value = sender.value;
	eventSrc3.object = object;
	eventSrc3.sender = sender;
	eventSrc3.evt = evt;
	inputDateTime3 = new Date();
	//-----------------------------------------------

	//品番自動ハイフン「-」を付ける
	var chkLen=4;
	if(event.keyCode != 0008){
		//指定の桁以上ならスタート
		//if(value.length>=chkLen){
		//	var hikaku = value.substring(chkLen, chkLen+1);
		//	if(hikaku != "-"){
		//		var frontValue = value.substring(0, chkLen);
		//		var backValue  = value.substring(chkLen, value.length);
		//		sender.value=frontValue+"-"+backValue;
		//	}
		//}
	}
	//小文字を大文字へ
	sender.value = sender.value.toUpperCase();
	value = sender.value;
	//-----------------------------------------------
	if ( value.length >= 3 ){
		if ( evt.keyCode == 37 || evt.keyCode == 39 ){
			
		}else{
			if ( timerId3 == null ){
				// 連続送信防止
				timerId3 = window.setTimeout(function(){text_onTimeOut3(object,sender,evt);},500);
			}
		}
	}
}

/**
* 一定時間入力が止まった場合に動作
*/
function text_onTimeOut3(object,sender,evt){
	var nowDateTime = new Date();
	var lngTime = (nowDateTime.getTime()-inputDateTime3.getTime());
	if ( lngTime >= 1000 ){
		timerId3 = null;
		
		
		xmlRequest3(object,sender,evt);
	}else{
		timerId3 = window.setTimeout(function(){text_onTimeOut3(eventSrc3.object,eventSrc3.sender,eventSrc3.evt);},500);
	}
}

/**
* XML要求処理
*/
function xmlRequest3(object,sender,evt){
	//alert_Custom(evt.keyCode);
	var table = document.getElementById("drop-contents3");
	table.innerHTML="";
	
	var top = calculateOffsetTop(sender);
	var left = calculateOffsetLeft(sender);
	var height = sender.offsetHeight;
	var panel = document.getElementById("dropdown-panel3");
	panel.style.top=top+height+"px";
	panel.style.left=left+"px";
	panel.style.display="block";
	

	
	var param="sysId=<%=GlobalConst.SETBI_KIBAN%>&"+"value1="+sender.value+"";
	

	try {
		var frm = document.main;
		var objs = frm["invCate"];
		
		if (objs[1].checked == true){
			//仮入出庫
			param += "&afterProc=1";
		}
	} catch (e) {
		
	}

	object.doXmlRequest(object,sender,param);
}


/**
* リスト選択時コールバック処理
*/
function list_onSelect3(object,sender,json){
	var panel = document.getElementById("dropdown-panel3");
	panel.style.display="none";
	sender.focus();
	
	//----------
	var name=sender.name;
	var idx=name.substring(name.indexOf("[")+1,name.length-1);
	
	document.getElementById("machineNo").value=json.valuecd;
	document.getElementById("machineNoTxt").value=json.value1;
	
	
}


function getElementsByClassName3(parent,tagName,className,fullMatch){
	
	var i=0,j=0;
	var result = [], cnt = 0;
	var list = parent.getElementsByTagName(tagName);
	for ( i=0; i<list.length; i++ ){
		var name = list[i].className;
		if ( name ){
			var nameList = name.split(' ');
			for ( j=0; j<nameList.length; j++ ){
				if ( fullMatch ){
					if ( nameList[j] == className ){
						result[cnt++] = list[i];
					}
				}else{
					if ( nameList[j].indexOf(className) != -1 ){
						result[cnt++] = list[i];
					}
				}
			}
		}
	}
	return result;
}
function closeBtn3(){
	var panel = document.getElementById("dropdown-panel3");
	panel.style.display="none";
} 
//----------------------------------------------------------------------

//-------------------------------------------------------------------------
//<!-- NumKeyBoard START -->
var		clsNKB			= new CNumKeyBoard();

//=================================================================
//	データ入力後の処理
//=================================================================
function afterInputData(obj) {
	var frm = document.forms.main;
	var parent_node = obj.parentNode;
	for(var i = 0; i < 2; i++) {
		if(parent_node.className == "ItemLine") {
			break;
		}
		parent_node = parent_node.parentNode;
	}
	var child_nodes = parent_node.getElementsByTagName("INPUT");
	for(var i = 0; i < child_nodes.length; i++) {
		if(child_nodes[i].className == "DetailStart") {
			// 開始時間の設定
			if(child_nodes[i].value == "") {
				child_nodes[i].value = FieldStart;
			}
		}
		if(child_nodes[i].className == "DetailEnd") {
			// 終了時間の設定
			child_nodes[i].value = frm.NowTime.value;
		}
		if(child_nodes[i].className == "DetailTime") {
			// 作業時間の設定
			child_nodes[i].value = convStrToNum(child_nodes[i].value) + Math.round(PassTime(new Date(FieldStart)) / 1000);
		}
		if(child_nodes[i].className == "InputChanged") {
			// 行変更フラグを設定
			child_nodes[i].value = "1";
		}
		if (child_nodes[i].className.match(/DetailDate/i)) {
			// 日付の設定
			child_nodes[i].value = delComma(child_nodes[i].value);
		}
	}
}
//--------------------------------
//カンマ削除関数
//--------------------------------
function delComma(w) {
var z = w.replace(/,/g,"");
return (z);
}

//--------------------------------
//	型変換 String→Numeric
//--------------------------------
function convStrToNum(strVal) {
	var cnv = Number(strVal);
	var res = 0;
	if(isNaN(cnv)) {
		// 数値じゃない!
	} else {
		res = cnv;
	}
	return res;
}
//<!-- NumKeyBoard END -->
//----------------------------------------------------------------------

//「登録」ボタン押下
function orderBtn(){
	
	validCheck("1");//入力チェックによる背景色を付ける
	
	//順番メモ
	//１：orderBtnExe
	orderBtnExe("1");
	
}

//「変更」ボタン押下
function updateBtn(){

	validCheck("2");//入力チェックによる背景色を付ける
	
	var delDivObj  =  document.getElementById("delDiv");  		//削除フラグ
	
	//削除がクリックされていれば追加チェック
	if(delDivObj.checked){
		//順番メモ
		//１：mRsvSupplyCheckDelete
		//２：updateDtCheck
		//３：orderBtnExe
		mRsvSupplyCheckDelete("2");
	}else{
		//順番メモ
		//１：updateDtCheck
		//２：orderBtnExe
		updateDtCheck("2");
	}

}

//入力チェックによる背景色を付ける
function validCheck(btnCate){

	//変更以外
	<%if(!"2".equals(strOutputCate)){ %>
		var itemNo = document.getElementById("itemNo"); 		
		//============
		//背景色解除
		//============
		itemNo.style.backgroundColor = 'white';
		
		//============
		//背景色設定
		//============
		if(itemNo.value =="" && btnCate !="2"){
			itemNo.style.backgroundColor = 'pink';
		}
		if(!itemNo.value.match(/^Y[0-9]{4}-[0-9]{5}$/) && btnCate !="2"){
			itemNo.style.backgroundColor = 'pink';
		}
		
		//新規時のみ
		if(btnCate =="1"){
			//予備品Mから存在チェック
			if(!mRsvSupplyCheck(btnCate)){
				itemNo.style.backgroundColor = 'pink';
			}
		}
	<%}%>


	var delDivObj  =  document.getElementById("delDiv");  		//削除フラグ
	var cntDiv = document.getElementById("cntDiv"); 			//カウント品可否
	var itemNm = document.getElementById("itemNm"); 			//品名
	var model = document.getElementById("model");				//型式
	var rackNo = document.getElementById("rackNo");			//棚番キー
	var rackNoTxt = document.getElementById("rackNoTxt");			//棚番
	var unitPrice  =  document.getElementById("unitPrice");  	//単価
	var leadTm  =  document.getElementById("leadTm");  		//リードタイム
	var machineNo = document.getElementById("machineNo");		//設備機番キー
	var machineNoTxt = document.getElementById("machineNoTxt");		//設備機番
	
	var basicStock  =  document.getElementById("basicStock");	//基準在庫
	var odrLot  =  document.getElementById("odrLot");  		//発注単位
	var odrPoint  =  document.getElementById("odrPoint");  	//発注点
	var newStock  =  document.getElementById("newStock");  	//新品在庫数
	var usedStock  =  document.getElementById("usedStock");  	//中古在庫数
	var upReason  =  document.getElementById("upReason");  	//変更理由
	
	//============
	//背景色解除
	//============
	//delDivObj.style.backgroundColor = 'white';
	cntDiv.style.backgroundColor = 'white';
	itemNm.style.backgroundColor = 'white';
	model.style.backgroundColor = 'white';
	rackNo.style.backgroundColor = 'white';
	rackNoTxt.style.backgroundColor = 'white';
	unitPrice.style.backgroundColor = 'white';
	leadTm.style.backgroundColor = 'white';
	machineNo.style.backgroundColor = 'white';
	machineNoTxt.style.backgroundColor = 'white';
	basicStock.style.backgroundColor = 'white';
	odrLot.style.backgroundColor = 'white';
	odrPoint.style.backgroundColor = 'white';
	newStock.style.backgroundColor = 'white';
	usedStock.style.backgroundColor = 'white';
	upReason.style.backgroundColor = 'white';
	//if(delDivObj.checked){
		rackNo.style.backgroundColor = '#CCC';
		rackNoTxt.style.backgroundColor = '#CCC';
		newStock.style.backgroundColor = '#CCC';
		usedStock.style.backgroundColor = '#CCC';
	//}
	//============
	//背景色設定
	//============
	//削除の時のみ
	//if(delDivObj.checked){
	//	var errMsg1="";
	//	if(rackNo !=""){
	//		errMsg1 += "[棚番]";
	//	}
	//	if(errMsg1 != ""){
	//		rackNo.style.backgroundColor = 'pink';
	//		newStock.style.backgroundColor = 'pink';
	//		usedStock.style.backgroundColor = 'pink';
	//	}
	//}
	//入力チェック（必須）-----------------------------------------------------------------start
	if(cntDiv.value ==""){
		cntDiv.style.backgroundColor = 'pink';
	}
	if(itemNm.value ==""){
		itemNm.style.backgroundColor = 'pink';
	}
	if(model.value ==""){
		model.style.backgroundColor = 'pink';
	}
	//if(rackNo.value =="" && !delDivObj.checked){
	//	rackNo.style.backgroundColor = 'pink';
	//}
	if(unitPrice.value ==""){
		unitPrice.style.backgroundColor = 'pink';
	}
	if(leadTm.value ==""){
		leadTm.style.backgroundColor = 'pink';
	}
	if(machineNo.value ==""){
		machineNo.style.backgroundColor = 'pink';
		machineNoTxt.style.backgroundColor = 'pink';
	}
	//if(upReason.value ==""){
	//	upReason.style.backgroundColor = 'pink';
	//}
	//入力チェック（必須）-----------------------------------------------------------------end
	//入力チェック-------------------------------------------------------------------------start
	
	if(rackNo.value !="" && !delDivObj.checked){
		//予備品Mから棚番の存在チェック
		if(!mRsvSupplyCheckRackNo(btnCate)){
			rackNo.style.backgroundColor = 'pink';
			rackNoTxt.style.backgroundColor = 'pink';
		}
	}
	
	if(delDivObj.checked <%if(!"inv3100".equals(strDisplayCate)){%>&& btnCate !="2"<%}%>){
		//delDivObj.style.backgroundColor = 'pink';
	}
	if(unitPrice.value < 1){
		unitPrice.style.backgroundColor = 'pink';
	}
	if(leadTm.value < 0){
		leadTm.style.backgroundColor = 'pink';
	}
	if(basicStock.value < 0){
		basicStock.style.backgroundColor = 'pink';
	}
	if(odrLot.value < 0){
		odrLot.style.backgroundColor = 'pink';
	}
	if(odrPoint.value < 0){
		odrPoint.style.backgroundColor = 'pink';
	}
	//入力チェック-------------------------------------------------------------------------end
}
//「登録」実行
//引数1:btnCate=1:登録 2:編集 3:
function orderBtnExe(btnCate){
	mainForm = document.getElementById("F1");

	var itemNo ="";

	//変更以外
	<%if(!"2".equals(strOutputCate)){ %>
		itemNo = document.getElementById("itemNo").value; 		
	<%}%>


	var delDivObj  =  document.getElementById("delDiv");  		//削除フラグ
	var cntDiv = document.getElementById("cntDiv").value; 			//カウント品可否
	var itemNm = document.getElementById("itemNm").value; 			//品名
	var model = document.getElementById("model").value;				//型式
	var rackNo = document.getElementById("rackNo").value;			//棚番
	var unitPrice  =  document.getElementById("unitPrice").value;  	//単価
	var leadTm  =  document.getElementById("leadTm").value;  		//リードタイム
	var machineNo = document.getElementById("machineNo").value;		//設備機番
	
	var basicStock  =  document.getElementById("basicStock").value;	//基準在庫
	var odrLot  =  document.getElementById("odrLot").value;  		//発注単位
	var odrPoint  =  document.getElementById("odrPoint").value;  	//発注点
	var newStock  =  document.getElementById("newStock").value;  	//新品在庫数
	var usedStock  =  document.getElementById("usedStock").value;  	//中古在庫数
	var upReason  =  document.getElementById("upReason").value;  	//変更理由
	
	
	//入力チェック-----------------------------------------------------------------start
	if(itemNo =="" && btnCate !="2"){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "Y品番")%>");
		return ;
	}
	//新規時のみ
	if(btnCate =="1"){
		//予備品Mから存在チェック
		if(!mRsvSupplyCheck(btnCate)){
			return ;
		}
	}
	if(!itemNo.match(/^Y[0-9]{4}-[0-9]{5}$/) && btnCate !="2"){
		alert_Custom("<%=Message.getMessage("WRN01180")%>");
		return ;
	}else if(delDivObj.checked <%if(!"inv3100".equals(strDisplayCate)){%>&& btnCate !="2"<%}%>){
		alert_Custom("<%=Message.getMessage("WRN00140")%>");
		return ;
	}
	if(cntDiv ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "カウント可否")%>");
		return ;
	}else if(itemNm ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "品名")%>");
		return ;
	}else if(model ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "型式")%>");
		return ;
	}
	
	if(rackNo !="" && !delDivObj.checked){
		//予備品Mから棚番の存在チェック
		if(!mRsvSupplyCheckRackNo(btnCate)){
			return ;
		}
	}
	
	if(machineNo ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "設備機番")%>");
		return ;
	}else if(unitPrice ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "単価")%>");
		return ;
	}else if(unitPrice < 1){
		alert_Custom("<%=Message.getMessage("WRN00061").replace("$1", "単価")%>");
		return ;
	}else if(leadTm ==""){
		alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "L/T")%>");
		return ;
	}else if(leadTm < 0){
		alert_Custom("<%=Message.getMessage("WRN00060").replace("$1", "L/T")%>");
		return ;
	}
	if(basicStock < 0){
		alert_Custom("<%=Message.getMessage("WRN00060").replace("$1", "基準在庫")%>");
		return ;
	}
	if(odrLot < 0){
		alert_Custom("<%=Message.getMessage("WRN00060").replace("$1", "発注単位")%>");
		return ;
	}
	if(odrPoint < 0){
		alert_Custom("<%=Message.getMessage("WRN00060").replace("$1", "発注点")%>");
		return ;
	}
	//}else if(upReason ==""){
	//	alert_Custom("<%=Message.getMessage("WRN00010").replace("$1", "メンテ理由")%>");
	//	return ;
	//入力チェック-----------------------------------------------------------------end
	
	if(btnCate=="1"){
		var afterFunc="yesOrderBtn();";
		if (!confirm_Custom3("<%=Message.getMessage("INF01060").replace("$1","直結看板以外予備品情報")%>",afterFunc)){
			return ;
		}
	}else if(btnCate=="2"){
		var afterFunc="yesUpdateBtn();";
		if (!confirm_Custom3("<%=Message.getMessage("INF01070").replace("$1","直結看板以外予備品情報")%>",afterFunc)){
			return ;
		}
	}
		
}

//「はい」を押された時
function yesOrderBtn(){
	document.getElementById("orderExe").value = "1";
	mainForm = document.getElementById("F1");
	mainForm.submit();
}

//「はい」を押された時
function yesUpdateBtn(){
	document.getElementById("updateExe").value = "1";
	mainForm = document.getElementById("F1");
	mainForm.submit();
}
	
function JSONConvert(node){
	var type = node.nodeType;
	if ( isTextNode(node) ){
		var text = getTextValue(node);
		return text;
	}
	if ( type==1 ){
		var json = {};
		var nodeName = node.nodeName;
		var childs = node.childNodes;

		for (var i = 0; i<childs.length; i++){
			var child = childs[i];
			var obj = json[child.nodeName];

			if ( child.nodeType == 1 ){
				if ( obj ){
					var array = null;
					if ( !isArray(obj) ){
						array=[];
						array[array.length]=obj;
					}else{
						array=json[child.nodeName];
					}
					array[array.length]=JSONConvert(child);
					json[child.nodeName]=array;
				}else{
					json[child.nodeName]=JSONConvert(child);
				}
			}
		}
		return json;
	}
}

function isTextNode(node){
	if ( node.hasChildNodes() ){
		var childs = node.childNodes;
		for (var i = 0; i<childs.length; i++){
			var child = childs[i];
			if ( child.nodeType != 3 ) return false;
		}
	}
	return true;
}

function getTextValue(node){
	if ( node.hasChildNodes() ){
		var childs = node.childNodes;
		var child = childs[0];
		if ( child.nodeType == 3 ){
			return child.nodeValue;
		}
	}
	return null;
}
//------------------------------------------------------------------------------

//*************************************************
//AJAX 部分(予備品Mから存在チェック)
//*************************************************
function mRsvSupplyCheck(btnCate){
	
	
	var findOdrNo = document.getElementById("itemNo").value;

	xmlHttp = new XMLHttpRequest();
	//xmlHttp.onreadystatechange = checkStatus2;
	xmlHttp.open("GET", "../itm2099/itm2099?itemCd="+findOdrNo, false);
	xmlHttp.send(null);

	//if (xmlHttp.status == 200){
	if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
		var xml = xmlHttp.responseXML;
		var rootNodes = xml.getElementsByTagName("list");
		var rootNode = rootNodes[0];
		var json = JSONConvert(rootNode);
		
		if (json==null) {
		}else {
			var itemNo1 = json.itemcd1;
			
			//存在チェック
			if(!itemNo1){
				//無し
				//mRsvSupplyCheckRackNo(btnCate); //出庫実行
				return true;
			}else{
				//有り
				//予備品として既に登録済みの品番です。
				alert_Custom("<%=Message.getMessage("WRN00130")%>");
				
				return false;
			}

		}
	}
	return false;
}

//*************************************************
//AJAX 部分(予備品Mから棚番の存在チェック)
//*************************************************
function mRsvSupplyCheckRackNo(btnCate){
	
	var findRackNo = document.getElementById("rackNo").value;
	var findKeyItemNo = document.getElementById("keyItemNo").value;
	
	var xmlHttp;

	xmlHttp = new XMLHttpRequest();
	//xmlHttp.onreadystatechange = checkStatus2;
	xmlHttp.open("GET", "../spa2001/spa2001?rackNo="+findRackNo+"&itemNo="+findKeyItemNo, false);
	xmlHttp.send(null);

	if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
		var xml = xmlHttp.responseXML;
		var rootNodes = xml.getElementsByTagName("list");
		var rootNode = rootNodes[0];
		var json = JSONConvert(rootNode);
		
		if (json==null) {
		}else {
			var rackNoExitFlg = json.rackNoExitFlg;
			
			//存在チェック
			if(!rackNoExitFlg){
				//無し
				//orderBtnExe(btnCate); //出庫実行
				return true;
			}else{
				//有り
				alert_Custom("<%=Message.getMessage("WRN00090").replace("$1","棚番")%>");
				return false;
			}

		}
	}
	return false;
}


//*************************************************
//AJAX 部分(確定時と発注時の予備品Mの更新日を比較)
//※※編集時のみ※※
//*************************************************
function updateDtCheck(btnCate){
	
	var findItemNo = document.getElementById("keyItemNo").value;
	
	var xmlHttp;

	xmlHttp = new XMLHttpRequest();
	xmlHttp.onreadystatechange = checkStatus2;
	xmlHttp.open("GET", "../itm2099/itm2099?itemCd="+findItemNo, false);
	xmlHttp.send(null);

	function checkStatus2(){
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
			var xml = xmlHttp.responseXML;
			var rootNodes = xml.getElementsByTagName("list");
			var rootNode = rootNodes[0];
			var json = JSONConvert(rootNode);
			if (json==null) {
			}else {
				var orderUpdateDt = json.updatedt;
				var confirmUdateDt = document.getElementById("updateDt_hid").value;
				var newStock = json.newstock;
				var useStock = json.usestock;
				//確定時と発注時の更新日を比較
				if(orderUpdateDt == confirmUdateDt){
					
					orderBtnExe(btnCate);
					
				}else{

					alert_Custom("<%=Message.getMessage("WRN01150").replace("$1", "予備品のマスタ情報").replace("$2", "予備品")%>");
					//予備品のマスタ情報が既に変更されています。発注を再度やり直して下さい。
					return;
				}

			}
		}
	}
}


//*************************************************
//AJAX 部分(発注Tと修理貸出Tから存在チェックし削除可能かチェック)
//※※編集時のみ※※
//*************************************************
function mRsvSupplyCheckDelete(btnCate){
	
	var findOdrNo = document.getElementById("keyItemNo").value;
	
	var xmlHttp;

	xmlHttp = new XMLHttpRequest();
	xmlHttp.onreadystatechange = checkStatus2;
	xmlHttp.open("GET", "../spa2002/spa2002?itemNo="+findOdrNo, false);
	xmlHttp.send(null);

	function checkStatus2(){
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
			var xml = xmlHttp.responseXML;
			var rootNodes = xml.getElementsByTagName("list");
			var rootNode = rootNodes[0];
			var json = JSONConvert(rootNode);
			
			if (json==null) {
			}else {
				var deleteExistFlg = json.deleteExistFlg;
				
				//存在チェック
				if(!deleteExistFlg){
					//無し
					updateDtCheck(btnCate);
					
				}else{
					//有り
					//Y品番は現在仕掛中であるため、削除できません。
					alert_Custom("<%=Message.getMessage("WRN01110")%>");
					
					return;
				}

			}
		}
	}
}

//予備品メンテ理由にセット
function setUpReason(){

	var UpReasonSel = document.getElementById("upReasonSelect");
	var UpReason = document.getElementById("upReason");

	UpReason.value = UpReasonSel.options[UpReasonSel.selectedIndex].text;
}

//削除チェックボックスにチェックが入った時＆初期表示の処理
function delDivChange(){
	var delDivObj = document.getElementById("delDiv");
	var rackNo = document.getElementById("rackNo");
	var rackNoTxt = document.getElementById("rackNoTxt");
	var usedStock = document.getElementById("usedStock");
	var newStock = document.getElementById("newStock");
	
	//直結以外は常に入力不可
	rackNo.disabled=true;
	rackNoTxt.disabled=true;
	usedStock.disabled=true;
	newStock.disabled=true;
	//rackNo.value="";
	//usedStock.value="";
	//newStock.value="";
	rackNo.style.backgroundColor="#CCC";
	rackNoTxt.style.backgroundColor="#CCC";
	usedStock.style.backgroundColor="#CCC";
	newStock.style.backgroundColor="#CCC";
	
}
</script>


</head>

<body onLoad="onInit()">
<form name="main" id="F1" action="./spa2100" method="post" class="frmMain"  onsubmit="return false;">
<div id="NumKeyBoardID"></div>
<table style="">
<%
//題名の設定
String headSubName="新規";
if("2".equals(strOutputCate) || "inv3100".equals(strDisplayCate)){
	headSubName = "変更";
}

%>
	<!--HEADER TITLE START -->
	<tr style = "background-color:#e1e1e1;  font-weight: bold;  border-bottom:1px solid #e1e1e1; background: -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#ffffff));　 ">
		<td colspan="2" class ="header_tbl" style = "font-size:22px; height:40px;"  align="left">
			予備品管理システム (<%=formBean.kojou%>)&nbsp;
			<span style="font-size:30px; text-shadow:2px 2px #666; 	color:#aaa;">直結看板以外予備品情報メンテナンス画面（<%=headSubName%>）</span>
		</td>
	</tr>
	<!--HEADER TITLE END -->

	<!--メインメニュー画面　START  -->
	<tr style="height:628px; ">

		<td class="right" >
			 <!--<div class="mainLine" id = "mainLine" style="display:inline; " ></div>  -->

			<table width ="100%"  class="mainTbl_Right" id="addTable">
				<!--発注 -->
				<tr>
					<td id="" align = "left"   class="selTitle" colspan="2">　Y品番:　&nbsp;
					<%if("2".equals(strOutputCate) || "inv3100".equals(strDisplayCate)){ %>
						<input type="text"  class="ReadStyle" name="itemNo1" id="itemNo1" style="width: 50px; height:25px; font-size:15px; color:blue; "  value="<%=formBean.getItemNo1() %>" readonly> -
						<input type="text"  class="ReadStyle" name="itemNo2" id="itemNo2" style="width: 50px; height:25px; font-size:15px; color:blue;"  value="<%=formBean.getItemNo2() %>" readonly>
						<%if("inv3100".equals(strDisplayCate)){%>
							<input type="hidden"  class="" name="itemNo" id="itemNo" value="<%=formBean.getItemNo1()%>-<%=formBean.getItemNo2()%>">
						<%} %>
					<%}else{ %>
						<input type="text"  class="" name="itemNo" id="itemNo" style="width: 100px; height:25px; font-size:15px; color:blue; "  value="<%=formBean.getItemNo() %>" onkeyup="itemNoKeyUp(this)" maxlength="11">
					<%} %>
					　カウント可否:
						<select name="cntDiv"  id="cntDiv"  style="width:120px; height:33px; font-size:15px; color:blue;" onChange="">
								<%
								String[] outSelect = {"",""};
								if("0".equals(formBean.getCntDiv())){
									outSelect[1] = "selected";
								}else{
									outSelect[0] = "selected";
								}
								%>
								<option value='1' <%=outSelect[0]%>>カウント品</option>
								<option value='0' <%=outSelect[1]%>>実勘省略品</option>
						</select>
						　　<span style="color:red;<%if("1".equals(strOutputCate) && !"inv3100".equals(strDisplayCate)){ %>display:none<%} %>">削除:
						<input type="checkbox"  class="" name="delDiv" id="delDiv" style="width: 42px; height:25px; "  value="1"<%=("1".equals(formBean.getDelDiv()) ? "checked":"") %> onchange="delDivChange();">
						</span>
					</td>

				</tr>

				<tr>
					<td id="" align = "left"  valign="top"  class="selTitle" colspan="3">　品名:　　
						<textarea name="itemNm" id="itemNm" cols="40" rows="2" style="width:  500px; font-size:15px; color:blue;" maxlength="100"><%=formBean.getItemNm() %></textarea>
					</td>
				</tr>
                <tr>
					<td id="" align = "left"  valign="top"  class="selTitle" colspan="3">　型式:　　
						<textarea name="model" id="model" cols="40" rows="2" style="width:  500px; font-size:15px; color:blue;" maxlength="100"><%=formBean.getModel() %></textarea>
					</td>
				</tr>

				<tr>
					<td id="" align = "left"   class="selTitle">　棚番:　　
						<!-- 
						<input type="text"  class="" name="rackNo" id="rackNo" style="width: 100px; height:25px; font-size:15px; color:blue;"  value="<%=formBean.getRackNo() %>" maxlength="8">
						 -->
						<%
						String rackNo = "";
						Spa2000Bean.PullData[] inputTanaList = formBean.getInputTanaList();
						for (int i = 0; inputTanaList != null && i < inputTanaList.length; i++) {
							Spa2000Bean.PullData data = inputTanaList[i];
							if(data.key.equals(formBean.getRackNo())){
								rackNo = data.value;
							}
						}
						%>
						<input type="hidden" name="rackNo" id="rackNo" value="<%=formBean.getRackNo()%>" >
						<input type="text" class="rackNo inputStyle" style="width:100px;" name="rackNoTxt" id="rackNoTxt" value="<%=rackNo%>" maxlength="8"><br>
					</td>

					<td id="" align = "left"   class="selTitle">　 　設備機番:
						<%
						String machineNo = "";
						Spa2000Bean.PullData[] inputMachineNoList = formBean.getInputMachineNoList();
						for (int i = 0; inputMachineNoList != null && i < inputMachineNoList.length; i++) {
							Spa2000Bean.PullData data = inputMachineNoList[i];
							if(data.key.equals(formBean.getMachineNo())){
								machineNo = data.value;
							}
						}
						%>
						<input type="hidden" name="machineNo" id="machineNo" value="<%=formBean.getMachineNo()%>" >
						<input type="text" class="machineNo inputStyle" style="width:220px;" name="machineNoTxt" id="machineNoTxt" value="<%=machineNo%>" maxlength="100"><br>
					</td>

					<td id="" align="left"   class="selTitle">
						<!--
						画像ファイル:
						<button onclick="nextPageJump('act2000');" class="orderCompletionBtn" >ファイル参照</button>
						-->
					</td>

				</tr>

				<tr>
					<td id="" align = "left"   class="selTitle">　単価:　　
					<input type="text"  class="" name="unitPrice" id="unitPrice" style="width: 100px; height:25px; font-size:15px; color:blue;text-align:right;"  value="<%=formBean.getUnitPrice() %>" onclick='clsNKB.setNumKeyBoard(this, 8, 0, true, 200);' onChange='afterInputData(this);' readonly></td>

					<td id="" align = "left"   class="selTitle">&nbsp;　　　仕入先:
						<select name="supplier"  id="supplier"  style="width:220px; height:33px; font-size:15px; color:blue;" onChange="">
								<option value=''selected></option>
								<%
								Spa2000Bean.PullData[] nputSupplierList = formBean.getInputSupplierList();
								for (int i = 0; nputSupplierList != null && i < nputSupplierList.length; i++) {
									Spa2000Bean.PullData data = nputSupplierList[i];
									if(data.key.equals(formBean.getSupplier())){
										data.selected = "selected";
									}
								%>
								<option value='<%=data.key%>' <%=data.selected%> ><%=data.value%></option>
								<%}%>
						</select>
					</td>

				</tr>

				<tr>
					<td id="" align = "left"   class="selTitle" >　L/T:　　&nbsp;&nbsp;
						<input type="text"  class="" name="leadTm" id="leadTm" style="width:100px; height:25px; font-size:15px; color:blue;text-align:right;"  value="<%=formBean.getLeadTm() %>" onclick='clsNKB.setNumKeyBoard(this, 3, 0, true, 200);' onChange='afterInputData(this);' readonly>
					</td>

					<td id="" align = "left"   class="selTitle">　&nbsp;部品メーカ:
						<select name="partsMaker"  id="partsMaker"  style="width:220px; height:33px; font-size:15px; color:blue;" onChange="">
								<option value=''selected></option>
								<%
								Spa2000Bean.PullData[] inputPartsMakerList = formBean.getInputPartsMakerList();
								for (int i = 0; inputPartsMakerList != null && i < inputPartsMakerList.length; i++) {
									Spa2000Bean.PullData data = inputPartsMakerList[i];
									if(data.key.equals(formBean.getPartsMaker())){
										data.selected = "selected";
									}
								%>
								<option value='<%=data.key%>' <%=data.selected%> ><%=data.value%></option>
								<%}%>
						</select>
					</td>
				</tr>

				<tr>
					<td id="" align = "left"   class="selTitle" colspan="4"><hr>　基準在庫:
						<input type="text"  class="" name="basicStock" id="basicStock" style="width: 100px; height:25px; font-size:15px; color:blue;text-align:right;"  value="<%=formBean.getBasicStock() %>" onclick='clsNKB.setNumKeyBoard(this, 3, 0, true, 200);' onChange='afterInputData(this);' readonly>　　&nbsp;&nbsp;&nbsp;
						発注単位:
						<input type="text"  class="" name="odrLot" id="odrLot" style="width: 100px; height:25px; font-size:15px; color:blue;text-align:right;"  value="<%=formBean.getOdrLot() %>" onclick='clsNKB.setNumKeyBoard(this, 3, 0, true, 200);' onChange='afterInputData(this);' readonly>　　　　　&nbsp;&nbsp;&nbsp;&nbsp;
						新品在庫:
						<input type="text"  class="" name="newStock" id="newStock" style="width: 100px; height:25px; font-size:15px; color:blue;text-align:right;"  value="<%=formBean.getNewStock() %>" onclick='clsNKB.setNumKeyBoard(this, 5, 0, true, 200);' onChange='afterInputData(this);' readonly>
					</td>
				</tr>
				<tr>
				<td></td>
					<td id="" align = "left"   class="selTitle" colspan="3">&nbsp;&nbsp;&nbsp;発注点:
						<input type="text"  class="" name="odrPoint" id="odrPoint" style="width: 100px; height:25px; font-size:15px; color:blue;text-align:right;"  value="<%=formBean.getOdrPoint() %>" onclick='clsNKB.setNumKeyBoard(this, 3, 0, true, 200);' onChange='afterInputData(this);' readonly>　　　　　　&nbsp;
						中古在庫:
						<input type="text"  class="" name="usedStock" id="usedStock" style="width: 100px; height:25px; font-size:15px; color:blue;text-align:right;"  value="<%=formBean.getUsedStock() %>" onclick='clsNKB.setNumKeyBoard(this, 5, 0, true, 200);' onChange='afterInputData(this);' readonly>
					</td>
				</tr>


				<!--線を引く -->
				<tr><td  colspan="4"><hr></td></tr>

				<tr>
					<td id="" align = "left"   class="selTitle" colspan="3">　メンテ理由:　
						<input type="text"  class="" name="upReason" id="upReason" style="width: 500px; height:25px; font-size:15px; color:blue;"  value="">
						<select name="upReasonSelect"  id="upReasonSelect"  style="width:22px; height:35px; font-size:15px; color:blue;" onChange="setUpReason();">
								<option value=''selected></option>
								<%
								Spa2000Bean.PullData[] inputUpReasonList = null;
								if("2".equals(strOutputCate)){
									inputUpReasonList = formBean.getInputUpReasonList_u();
								}else{
									inputUpReasonList = formBean.getInputUpReasonList_i();
								}
								for (int i = 0; inputUpReasonList != null && i < inputUpReasonList.length; i++) {
									Spa2000Bean.PullData data = inputUpReasonList[i];
								%>
								<option value='<%=data.key%>' <%=data.selected%> ><%=data.value%></option>
								<%}%>
						</select>
					</td>
				</tr>

				<tr>
					<td id="" align = "left"   class="selTitle" colspan="2">
					
					</td>
					<td align = "right" >
<%
//題名の設定
String buttonName="登録";
if("2".equals(strOutputCate) || "inv3100".equals(strDisplayCate)){
	buttonName = "変更";
}
%>
						<%if("2".equals(strOutputCate)){ %>
							<input type="button" class="button" onclick="updateBtn();" class="confirmBtn2" value="変更">　　
						<%}else{ %>
							<input type="button" class="button" onclick="orderBtn();" class="confirmBtn2" value="<%=buttonName %>">　　
						<%} %>
					</td>
					<td align = "right" >
						<input type="button" class="button" onclick="backBtn('spa1000');" class="confirmBtn"  value="戻る">　
					</td>

				</tr>

			</table>


			<!--ログインMAIN画面　END  -->

		</td>
	</tr>
</table>
	<div class='footer' align='right' style="font-size:35px; background-image: url(../../common/img/toyotaB.png); background-repeat: no-repeat; align:top;" ></div> 
    <div class='ImageZone' align='right' style="font-size:20px; align:top"><img src='<%=appMng.getAppConfig("userconfig.imagepath")%><%=formBean.getPicfileNm()%>' height='150px' width='330px'></div>

	<input type="hidden" id="nextPage" name="nextPage" value="">
	<input type="hidden" id="orderExe" name="orderExe" value="">
	<input type="hidden" id="updateExe" name="updateExe" value="">
	<input type="hidden" id="stateFlg" name="stateFlg" value="">
	
	<input type="hidden" id="keyItemNo" name="keyItemNo" value="<%=formBean.getKeyItemNo() %>">
	<input type="hidden" id="outputCate" name="outputCate" value="<%=formBean.getOutputCate() %>">
	<input type="hidden" id="updateDt_hid" name="updateDt_hid" value="<%=formBean.getUpdateDt_hid() %>">
	
	<input type="hidden" id="displayCate" name="displayCate" value="<%=formBean.getDisplayCate() %>">
	<input type="hidden" id="picfileNm" name="picfileNm" value="<%=formBean.getPicfileNm() %>">
	<!-- 履歴用 -->
	<input type="hidden" id="unitPriceOld" name="unitPriceOld" value="<%=formBean.getUnitPriceOld() %>">
	<input type="hidden" id="basicStockOld" name="basicStockOld" value="<%=formBean.getBasicStockOld() %>">
	<input type="hidden" id="odrLotOld" name="odrLotOld" value="<%=formBean.getOdrLotOld() %>">
	<input type="hidden" id="odrPointOld" name="odrPointOld" value="<%=formBean.getOdrPointOld() %>">
	<input type="hidden" id="newStockOld" name="newStockOld" value="<%=formBean.getNewStockOld() %>">
	<input type="hidden" id="usedStockOld" name="usedStockOld" value="<%=formBean.getUsedStockOld() %>">
	

<!-- RACKNO-DROPDOWN START -->
<div class="dropdown-panel" id="dropdown-panel2">
	<div class="dropdown-panel-in">
		<div class="header">
			<div style="float:left;width:110px;height:20px;">
				<table border=0>
					<tr>
						<td style="width:110px;height:20px;">棚番</td>
					</tr>
				</table>
			</div>
			<div style="float:right;width:40px;text-align:right;">
				<button class="closebtn" type="button" onClick="closeBtn2();" style="width:18px;height:17px; padding:0px;">
					<img src="../../common/js/dropdown/close.gif" alt="閉じる">
				</button>
			</div>
		</div>
		<div class="drop-contents" id="drop-contents2">
		</div>
		<div class="footer"></div>
	</div>
</div>
<!-- RACKNO-DROPDOWN END -->

<!-- MACHINE-DROPDOWN START -->
<div class="dropdown-panel" id="dropdown-panel3">
	<div class="dropdown-panel-in">
		<div class="header">
			<div style="float:left;width:100px;height:20px;">
				<table border=0>
					<tr>
						<td style="width:100px;height:20px;">設備機番</td>
					</tr>
				</table>
			</div>
			<div style="float:right;width:40px;text-align:right;">
				<button class="closebtn" type="button" onClick="closeBtn3();" style="width:18px;height:17px; padding:0px;">
					<img src="../../common/js/dropdown/close.gif" alt="閉じる">
				</button>
			</div>
		</div>
		<div class="drop-contents" id="drop-contents3">
		</div>
		<div class="footer"></div>
	</div>
</div>
<!-- MACHINE-DROPDOWN END -->

	<!--警告 ポップアップ---------------------------------------------------------------------------- -->
	<div id="allbackgr" class="allbackgr" style="display:none;"></div>
	<div class="opAlertBtn" id = "opAlertBtn" style="display:none;" ></div>
	<div class="opAlertButton" id = "opAlertButton" style="display:none;" ></div>
	<div class="opAlertTop" id = "opAlertTop" style="display:none; font-size:22px;">　予備品管理システム　</div>
	<div class="opAlert" id = "opAlert" style="display:none;"></div>
	<!-- -------------------------------------------------------------------------------------------- -->
</form>
</body>
</html>
